package day240602.e1;

import java.io.IOException;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Test {
    public static void main(String[] args) throws IOException {
        User user = new User();
        Scanner sc = new Scanner(System.in);
        boolean flag = true;
        user.load();

        while (flag) {
            System.out.println("1. 增加学生\n" +
                    "2. 删除学生\n" +
                    "3. 修改学生信息\n" +
                    "4. 查找学生信息\n" +
                    "5. 输出所有学生信息\n" +
                    "6. 退出系统 ");

            System.out.println("请选择你的操作：");
            int n = sc.nextInt();

            switch (n) {
                case 1:
                    user.addStudent();
                    break;
                case 2:
                    user.removeStudent();
                    break;
                case 3:
                    user.redactStudent();
                    break;
                case 4:
                    user.printStudents();
                    break;
                case 5:
                    user.printAllStudents();
                    break;
                case 6:
                    user.save();
                    flag = false;
                    break;
            }

        }
    }
}
